package service.impl;

import dao.IUserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import service.IUserService;

/**
 * 模拟业务层
 */
@Service
@Transactional
public class UserServiceImpl implements IUserService {

    @Autowired
    private IUserDao userDao;

    /**
     * 虽然类上使用了@Transaction注解 但是没啥用
     * 因为DriverManagerDataSource太笨了
     */
    @Override
    public void saveUser() {
        userDao.saveUser();
        int i = 1/0;
    }

    @Override
    public void updateUser() {
        userDao.updateUser();
    }
}
